//
//  FileCancel.swift
//  Trans
//
//  Created by zcj on 2024/12/17.
//  description: 文件取消请求的，无论哪边发送了，都直接取消该文件的传输

import Foundation

class FileCancel:BaseData{
    var fileId:FileId = 0
    

    init(fileId:FileId) {
        self.fileId = fileId
        super.init()
    }
    
    enum CodingKeys: String, CodingKey{
        
        case fileId
    }
    
    required init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy:CodingKeys.self)
        fileId = try container.decode(FileId.self, forKey: .fileId)
        try super.init(from: decoder)
    }
    
    override func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(fileId, forKey: .fileId)
        try super.encode(to: encoder)
    }
    
    override func getType() -> UINT32 {
        return FILE_CANCEL;
    }
}
